package com.maxd.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 班级课程表
 */
@Entity
@Getter
@Setter
@ToString
@SuperBuilder
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@ApiModel("班级课程表")
@Table(name = "class_lesson_info")
public class ClassLessonInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @ApiModelProperty("自增主键")
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty("班级ID")
    @Column(name = "class_id", nullable = false)
    @NotNull(message = "班级不能为空")
    private Long classId;

    @ApiModelProperty("班级名称")
    @Column(name = "class_name", nullable = false)
    private String className;

    @ApiModelProperty("教官用户ID")
    @Column(name = "instructor_user_id", nullable = false)
    private Long instructorUserId;

    @ApiModelProperty("小区主理人用户ID")
    @Column(name = "assistant_user_id")
    private Long assistantUserId;

    @ApiModelProperty("上课日期，格式为yyyy-MM-dd")
    @Column(name = "lesson_date", nullable = false)
    @NotBlank(message = "上课日期不能为空")
    private String lessonDate;

    @ApiModelProperty("开始时间")
    @Column(name = "start_time", nullable = false)
    @NotBlank(message = "开始时间不能为空")
    private String startTime;

    @ApiModelProperty("结束时间")
    @Column(name = "end_time", nullable = false)
    @NotBlank(message = "结束时间不能为空")
    private String endTime;

    @ApiModelProperty("上课地点")
    @Column(name = "address", nullable = false)
    @NotBlank(message = "上课地点不能为空")
    private String address;

    @ApiModelProperty("状态 0-未完成 1-已完成")
    @Column(name = "status", nullable = false)
    private String status;

    @Column(name = "sign_students")
    @ApiModelProperty("签到学生列表，格式为JSON列表")
    private String signStudents;

    @Column(name = "sign_images")
    @ApiModelProperty("课堂图片，格式为JSON列表")
    private String signImages;

    @ApiModelProperty("创建时间")
    @Column(name = "create_time", nullable = false)
    private Date createTime;

    @ApiModelProperty("更新时间")
    @Column(name = "update_time", nullable = false)
    private Date updateTime;

    @ApiModelProperty("创建人")
    @Column(name = "create_by")
    private String createBy;

    @ApiModelProperty("更新人")
    @Column(name = "update_by")
    private String updateBy;

}
